package com.devin.service.Impl;

import com.devin.dao.LogMapper;
import com.devin.dao.MultiMapper;
import com.devin.pojo.LogLogin;
import com.devin.service.LogService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("logService")
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    @Autowired
    private MultiMapper multiMapper;

    @Override
    public void saveLog(LogLogin log) {
        logMapper.saveLog(log);
    }

    @Override
    public List<LogLogin> findLogs(Integer page,Integer size) {
        PageHelper.startPage(page,size);
        List<LogLogin> logs = logMapper.findLogs();
        return logs;
    }

    @Override
    public void delLogById(Integer id) {
        logMapper.delLogById(id);
    }

    @Override
    public void delLogsChecked(Integer[] ids) {
        multiMapper.delLogsChecked(ids);
    }
}
